export default class BaseSingleClass {

    public static instance<T extends {}>(this: new () => T): T {
        if (!(<any>this)._instance) {
            (<any>this)._instance = new this;
        }
        return (<any>this)._instance;
    }

    public static recycle() {
        (<any>this)._instance = null;
    }
}